if(!require(ggplot2)){ # 拡張パッケージはインストールされているか?
# 拡張パッケージのインストール
install.packages("ggplot2")
# 拡張パッケージの読み込み
library(ggplot2)
}
## Loading required package: ggplot2
if(!require(pdftools)){ # 拡張パッケージはインストールされているか?
# 拡張パッケージのインストール
install.packages("pdftools")
# 拡張パッケージの読み込み
library(pdftools)
}
## Loading required package: pdftools
if(.Platform$OS.type=="windows")
windowsFonts(yugo=windowsFont("Yu Gothic"))
if(capabilities("aqua"))
quartzFonts(yugo=quartzFont(rep("YuGo-Medium",4)))
url = "http://www.hit-u.ac.jp/guide/information/data/pdf/06_kakenhi_2016.pdf"
url = "day03/06_kakenhi_2016.pdf"
res <- pdf_text(url)
#res<-iconv(res[1],to="UTF-8")
res<-gsub(",","",res[1])
res<-gsub(" +",",",res[1])
df16<-read.csv(text=res[1],skip = 5,header = FALSE,stringsAsFactors = FALSE)
df16<-df16[-(13:nrow(df16)),]
df16$V2<-as.numeric(df16$V2)
g1<-ggplot(df16,aes(x=V1,y=V2))+geom_bar(stat="identity")+xlab("研究種目")+ylab("交付件数")+theme_gray(base_family ="yugo")+theme(axis.text.x = element_text(angle = 90, hjust = 1),plot.margin = grid::unit(c(.5, 1, .5, 0), "cm"))
g1

g2<-ggplot(df16,aes(x=V1,y=(V3+V4)/10000,group=1))+geom_line(colour = "magenta",linetype = 2,size = 0.5 )+xlab("研究種目")+ylab("交付額(万円)")+theme_bw(base_family ="yugo")+theme(axis.text.x = element_text(angle = 90, hjust = 1),plot.margin = grid::unit(c(.5, 1, .5, 0), "cm"),panel.grid.major = element_blank(),panel.grid.minor = element_blank(),panel.background = element_blank())
g2

if(!require(plotflow)){
devtools::install_github("trinker/plotflow")
library(plotflow)
}
## Loading required package: plotflow
ggdual_axis(lhs = g1, rhs = g2)

url = "http://www.hit-u.ac.jp/guide/information/data/pdf/06_kakenhi_2015.pdf"
url = "day03/06_kakenhi_2015.pdf"
res <- pdf_text(url)
#res<-iconv(res[1],to="UTF-8")
res<-gsub(",","",res[1])
res<-gsub(" +",",",res[1])
df15<-read.csv(text=res[1],skip = 5,header = FALSE,stringsAsFactors = FALSE)
df15<-df15[-(12:nrow(df15)),]
df15$V2<-as.numeric(df15$V2)
g1<-ggplot(df15,aes(x=V1,y=V2))+geom_bar(stat="identity")+xlab("研究種目")+ylab("交付件数")+theme_gray(base_family ="yugo")+theme(axis.text.x = element_text(angle = 90, hjust = 1),plot.margin = grid::unit(c(.5, 1, .5, 0), "cm"))
g1

g2<-ggplot(df15,aes(x=V1,y=(V3+V4)/10000,group=1))+geom_line(colour = "magenta",linetype = 2,size = 0.5 )+xlab("研究種目")+ylab("交付額(万円)")+theme_bw(base_family ="yugo")+theme(axis.text.x = element_text(angle = 90, hjust = 1),plot.margin = grid::unit(c(.5, 1, .5, 0), "cm"),panel.grid.major = element_blank(),panel.grid.minor = element_blank(),panel.background = element_blank())
g2

if(!require(plotflow)){
devtools::install_github("trinker/plotflow")
library(plotflow)
}
ggdual_axis(lhs = g1, rhs = g2)

url = "http://www.hit-u.ac.jp/guide/information/data/pdf/06_kakenhi_2014.pdf"
url = "day03/06_kakenhi_2014.pdf"
res <- pdf_text(url)
#res<-iconv(res[1],to="UTF-8")
res<-gsub(",","",res[1])
res<-gsub(" +",",",res[1])
df14<-read.csv(text=res[1],skip = 5,header = FALSE,stringsAsFactors = FALSE)
df14<-df14[-(13:nrow(df14)),]
df14$V2<-as.numeric(df14$V2)
g1<-ggplot(df14,aes(x=V1,y=V2))+geom_bar(stat="identity")+xlab("研究種目")+ylab("交付件数")+theme_gray(base_family ="yugo")+theme(axis.text.x = element_text(angle = 90, hjust = 1),plot.margin = grid::unit(c(.5, 1, .5, 0), "cm"))
g1
## Warning: Removed 1 rows containing missing values (position_stack).

g2<-ggplot(df14,aes(x=V1,y=(V3+V4)/10000,group=1))+geom_line(colour = "magenta",linetype = 2,size = 0.5 )+xlab("研究種目")+ylab("交付額(万円)")+theme_bw(base_family ="yugo")+theme(axis.text.x = element_text(angle = 90, hjust = 1),plot.margin = grid::unit(c(.5, 1, .5, 0), "cm"),panel.grid.major = element_blank(),panel.grid.minor = element_blank(),panel.background = element_blank())
g2
## Warning: Removed 1 rows containing missing values (geom_path).

if(!require(plotflow)){
devtools::install_github("trinker/plotflow")
library(plotflow)
}
ggdual_axis(lhs = g1, rhs = g2)
## Warning: Removed 1 rows containing missing values (position_stack).
## Warning: Removed 1 rows containing missing values (geom_path).

url = "http://www.hit-u.ac.jp/guide/information/data/pdf/06_kakenhi_2013.pdf"
url = "day03/06_kakenhi_2013.pdf"
res <- pdf_text(url)
#res<-iconv(res[1],to="UTF-8")
res<-gsub(",","",res[1])
res<-gsub(" +",",",res[1])
df13<-read.csv(text=res[1],skip = 5,header = FALSE,stringsAsFactors = FALSE)
df13<-df13[-(13:nrow(df13)),]
df13$V2<-as.numeric(df13$V2)
g1<-ggplot(df13,aes(x=V1,y=V2))+geom_bar(stat="identity")+xlab("研究種目")+ylab("交付件数")+theme_gray(base_family ="yugo")+theme(axis.text.x = element_text(angle = 90, hjust = 1),plot.margin = grid::unit(c(.5, 1, .5, 0), "cm"))
g1

g2<-ggplot(df13,aes(x=V1,y=(V3+V4)/10000,group=1))+geom_line(colour = "magenta",linetype = 2,size = 0.5 )+xlab("研究種目")+ylab("交付額(万円)")+theme_bw(base_family ="yugo")+theme(axis.text.x = element_text(angle = 90, hjust = 1),plot.margin = grid::unit(c(.5, 1, .5, 0), "cm"),panel.grid.major = element_blank(),panel.grid.minor = element_blank(),panel.background = element_blank())
g2
## Warning: Removed 1 rows containing missing values (geom_path).

if(!require(plotflow)){
devtools::install_github("trinker/plotflow")
library(plotflow)
}
ggdual_axis(lhs = g1, rhs = g2)
## Warning: Removed 1 rows containing missing values (geom_path).

url = "http://www.hit-u.ac.jp/guide/information/data/pdf/06_kakenhi_2012.pdf"
url = "day03/06_kakenhi_2012.pdf"
res <- pdf_text(url)
#res<-iconv(res[1],to="UTF-8")
res<-gsub(",","",res[1])
res<-gsub(" +",",",res[1])
df12<-read.csv(text=res[1],skip = 5,header = FALSE,stringsAsFactors = FALSE)
df12<-df12[-(13:nrow(df12)),]
df12$V2<-as.numeric(df12$V2)
g1<-ggplot(df12,aes(x=V1,y=V2))+geom_bar(stat="identity")+xlab("研究種目")+ylab("交付件数")+theme_gray(base_family ="yugo")+theme(axis.text.x = element_text(angle = 90, hjust = 1),plot.margin = grid::unit(c(.5, 1, .5, 0), "cm"))
g1

g2<-ggplot(df12,aes(x=V1,y=(V3+V4)/10000,group=1))+geom_line(colour = "magenta",linetype = 2,size = 0.5 )+xlab("研究種目")+ylab("交付額(万円)")+theme_bw(base_family ="yugo")+theme(axis.text.x = element_text(angle = 90, hjust = 1),plot.margin = grid::unit(c(.5, 1, .5, 0), "cm"),panel.grid.major = element_blank(),panel.grid.minor = element_blank(),panel.background = element_blank())
g2
## Warning: Removed 1 rows containing missing values (geom_path).

if(!require(plotflow)){
devtools::install_github("trinker/plotflow")
library(plotflow)
}
ggdual_axis(lhs = g1, rhs = g2)
## Warning: Removed 1 rows containing missing values (geom_path).

url = "http://www.hit-u.ac.jp/guide/information/data/pdf/06_kakenhi_2011.pdf"
url = "day03/06_kakenhi_2011.pdf"
res <- pdf_text(url)
#res<-iconv(res[1],to="UTF-8")
res<-gsub(",","",res[1])
res<-gsub(" +",",",res[1])
df11<-read.csv(text=res[1],skip = 5,header = FALSE,stringsAsFactors = FALSE)
df11<-df11[-(15:nrow(df11)),]
df11$V2<-as.numeric(df11$V2)
g1<-ggplot(df11,aes(x=V1,y=V2))+geom_bar(stat="identity")+xlab("研究種目")+ylab("交付件数")+theme_gray(base_family ="yugo")+theme(axis.text.x = element_text(angle = 90, hjust = 1),plot.margin = grid::unit(c(.5, 1, .5, 0), "cm"))
g1

g2<-ggplot(df11,aes(x=V1,y=(V3+V4)/10000,group=1))+geom_line(colour = "magenta",linetype = 2,size = 0.5 )+xlab("研究種目")+ylab("交付額(万円)")+theme_bw(base_family ="yugo")+theme(axis.text.x = element_text(angle = 90, hjust = 1),plot.margin = grid::unit(c(.5, 1, .5, 0), "cm"),panel.grid.major = element_blank(),panel.grid.minor = element_blank(),panel.background = element_blank())
g2

if(!require(plotflow)){
devtools::install_github("trinker/plotflow")
library(plotflow)
}
ggdual_axis(lhs = g1, rhs = g2)

url = "http://www.hit-u.ac.jp/guide/information/data/pdf/06_kakenhi_2010.pdf"
url = "day03/06_kakenhi_2010.pdf"
res <- pdf_text(url)
#res<-iconv(res[1],to="UTF-8")
res<-gsub(",","",res[1])
res<-gsub(" +",",",res[1])
df10<-read.csv(text=res[1],skip = 5,header = FALSE,stringsAsFactors = FALSE)
df10<-df10[-(15:nrow(df10)),]
df10$V2<-as.numeric(df10$V2)
g1<-ggplot(df10,aes(x=V1,y=V2))+geom_bar(stat="identity")+xlab("研究種目")+ylab("交付件数")+theme_gray(base_family ="yugo")+theme(axis.text.x = element_text(angle = 90, hjust = 1),plot.margin = grid::unit(c(.5, 1, .5, 0), "cm"))
g1

g2<-ggplot(df10,aes(x=V1,y=(V3+V4)/10000,group=1))+geom_line(colour = "magenta",linetype = 2,size = 0.5 )+xlab("研究種目")+ylab("交付額(万円)")+theme_bw(base_family ="yugo")+theme(axis.text.x = element_text(angle = 90, hjust = 1),plot.margin = grid::unit(c(.5, 1, .5, 0), "cm"),panel.grid.major = element_blank(),panel.grid.minor = element_blank(),panel.background = element_blank())
g2

if(!require(plotflow)){
devtools::install_github("trinker/plotflow")
library(plotflow)
}
ggdual_axis(lhs = g1, rhs = g2)

url = "http://www.hit-u.ac.jp/guide/information/data/pdf/06_kakenhi_2009.pdf"
url = "day03/06_kakenhi_2009.pdf"
res <- pdf_text(url)
#res<-iconv(res[1],to="UTF-8")
res<-gsub(",","",res[1])
res<-gsub(" +",",",res[1])
df09<-read.csv(text=res[1],skip = 6,header = FALSE,stringsAsFactors = FALSE)
df09<-df09[-(12:nrow(df09)),]
df09$V2<-as.numeric(df09$V2)
g1<-ggplot(df09,aes(x=V1,y=V2))+geom_bar(stat="identity")+xlab("研究種目")+ylab("交付件数")+theme_gray(base_family ="yugo")+theme(axis.text.x = element_text(angle = 90, hjust = 1),plot.margin = grid::unit(c(.5, 1, .5, 0), "cm"))
g1

g2<-ggplot(df09,aes(x=V1,y=(V3+V4)/10000,group=1))+geom_line(colour = "magenta",linetype = 2,size = 0.5 )+xlab("研究種目")+ylab("交付額(万円)")+theme_bw(base_family ="yugo")+theme(axis.text.x = element_text(angle = 90, hjust = 1),plot.margin = grid::unit(c(.5, 1, .5, 0), "cm"),panel.grid.major = element_blank(),panel.grid.minor = element_blank(),panel.background = element_blank())
g2
## Warning: Removed 1 rows containing missing values (geom_path).

if(!require(plotflow)){
devtools::install_github("trinker/plotflow")
library(plotflow)
}
ggdual_axis(lhs = g1, rhs = g2)
## Warning: Removed 1 rows containing missing values (geom_path).
